<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div>前后端交互</div>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript">
        $.ajax({
            url: 'http://localhost:3000/data',
            success: function(data) {
                console.log(data);
            }
        });
        // 多个异步处理模式
        $.ajax({
            url: 'http://localhost:3000/data1',
            success: function(data) {
                console.log(data);
                $.ajax({
                    url: 'http://localhost:3000/data2',
                    success: function(data) {
                        console.log(data);
                        $.ajax({
                            url: 'http://localhost:3000/data2',
                            success: function(data) {
                                console.log(data);
                            }
                        })
                    }
                })
            }
        });
    </script>
</body>

</html>